/*
 * @Description: 描述
 * @Author: liym
 * @Date: 2025-05-09 17:40:48
 * @LastEditors: liym
 * @LastEditTime: 2025-06-06 17:15:39
 */
import request from '@/common/request.js'

export const loginApi = (data) => {
	return request.post('/user/login', data)
}

export const getAgentsApi = (data) => {
	return request.get('/user/selectUserPageByRole', data)
}

// 修改的代理信息
export const updateUserApi = (data) => {
  return request.post('/user/updateUser', data)
}

// 新增代理信息
export const addUserApi = (data) => {
  return request.post('/user/addUser', data)
}
// 修改密码
export const changePasswordApi = (data) => {
  return request.post('/user/changePassword', data)
}

// 根据id查询代理信息
export const getUserByIdApi = (data) => {
  return request.get('/user/queryUserById', data)
}

// 删除代理
export const deleteUserApi = (data) => {
  return request.get('/user/deleteUser', data)
}

// 二维码生成
export const generateCodeApi = (data) => {
  return request.post('/qrCode/generate', data)
}

// 获取二维码
export const getCodeApi = (data) => {
  return request.get('/qrCode/getCodeContent', data)
}


export const getOrdersApi = (data) => {
  return request.get('/order/getList', data)
}
export const getOrdersStatisticsApi = (params) => {
  return request.get('/order/getStatisticsOder', params)
}

// 修改的代理信息
export const updateOrderApi = (data) => {
  return request.post('/order/updateOrder', data)
}

// 新增代理信息
export const addOrderApi = (data) => {
  return request.post('/order/create', data)
}

// 删除代理
export const deleteOrderApi = (orderId) => {
  return request.delete(`/order/deleteOrder?orderId=${orderId}`)
}
